// 封装好的滑动引导页
// 使用方法：IntroSlider("/login");
import 'package:flutter/material.dart';
import 'package:intro_views_flutter/Models/page_view_model.dart';
import 'package:intro_views_flutter/intro_views_flutter.dart';
import '../routers/application.dart';


final pages = [
    PageViewModel(
        pageColor:Color(0xFF03A9F4),
        // bubble: Image.asset("image/logo.png"),
        body: Text("页面介绍1"),
        title: Text("引导页1"),
        mainImage: Image.asset(
            "image/a.png",
            height: 285.0,
            width: 285.0,
            alignment: Alignment.center,
        )
    ),
    PageViewModel(
        pageColor:Colors.yellow,
        // bubble: Image.asset("image/logo.png"),
        body: Text("页面介绍2"),
        title: Text("引导页2"),
        textStyle: TextStyle(
            color: Colors.red,
        ),
        mainImage: Image.asset(
            "image/a1.png",
            height: double.infinity,
            width: double.infinity,
        )
    ),
    PageViewModel(
        pageColor:Colors.green,
        // bubble: Image.asset("image/logo.png"),
        body: Text("页面介绍3"),
        title: Text("引导页3"),
        textStyle: TextStyle(
            color: Colors.red,
        ),
        mainImage: Image.asset(
            "image/setting.png",
            height: 285.0,
            width: 285.0,
            alignment: Alignment.center,
        )
    )
];

class IntroSlider extends StatelessWidget{
    IntroSlider(this.navigatorPath);

    final String navigatorPath;

    @override
    Widget build(BuildContext context){
        return IntroViewsFlutter(
            pages,
            onTapDoneButton:(){
                Application.router.navigateTo(context, navigatorPath);
            },
            showSkipButton:false,
            doneText:Text("进入APP")
        );
    }

}


